/**
 * Created with IntelliJ IDEA.
 * User: Nikita.Brazhnikov
 * Date: 9/28/12
 * Time: 12:35 PM
 * To change this template use File | Settings | File Templates.
 */
$(function(){
  $("#msg_sendbtn").click(function() {
        addMessage();
  });
})
function addMessage() {
    var msgText = $("#msg_input").val();
    if ($.trim(msgText).length > 0) {
        var messageBlock = $(".msg_template").clone();
        messageBlock.text(msgText);
        messageBlock.removeClass("msg_template");
        messageBlock.appendTo("#messages_pane");
        messageBlock.addClass("msg_displayed");
        $("#msg_input").val("");
    }
}